The Arduino is a small, inexpensive computer that can be programmed to control endless creations limited only by your imagination. As you’ll soon see, the Arduino can be used to make a whole host of projects, like a ghost detector, joystick-controlled laser, electronic die, laser trip wire alarm, motion sensor alarm, keypad entry system, and many others. All of these projects are easy to build and have one thing in common—they use the power of the Arduino. In the early 1980s, I picked up a great Penguin paperback titled something like Gadgets and Gizmos, hidden away in a local bookstore. The projects were simple ones like making a working lighthouse using flashlight bulbs and building a revolving display table using an old clock. The ideas in that book sparked my imagination, and I’ve been creating ever since.
20 Easy Raspberry Pi® Projects. Copyright © 2018 by Rui Santos and Sara Santos. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-10: 1-59327-843-8 ISBN-13: 978-1-59327-843-4 Publisher: William Pollock Production Editor: Laurel Chun Cover Design: Mimi Heft Interior Design: Beth Middleworth Developmental Editor: Liz Chadwick Technical Reviewer: Les Pounder Copyeditor: Rachel Monaghan Compositors: Meg Sneeringer and Laurel Chun Proofreader: James Fraleigh Cover artwork: “Electronic Circuit Board” by Creativity103 (licensed under CC BY 2.0). Circuit diagrams made using Fritzing (http://fritzing.org/). The following photographs are reproduced with permission: Figure 0-2 © Jud Froelich (courtesy of SeeMoreProject) and Figure 13-2 © Naturebytes. For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly: No Starch Press, Inc. 245 8th Street, San Francisco, CA 94103 phone: 1.415.863.9900; info@nostarch.com www.nostarch.com Library of Congress Cataloging-in-Publication Data: Names: Santos, Rui (Writer on electronics), author. | Santos, Sara, author. | Raspberry Pi Foundation. Title: 20 easy Raspberry Pi projects : toys, tools, gadgets, and more! / Rui Santos and Sara Santos. Description: San Francisco : No Starch Press, Inc., [2018] Identifiers: LCCN 2017046491 (print) | LCCN 2017059387 (ebook) | ISBN 9781593278717 (epub) | ISBN 1593278713 (epub) | ISBN 9781593278434 (pbk.) | ISBN 1593278438 (pbk.) | ISBN 9781593278717 (ebook) | ISBN 1593278713 (ebook) Subjects: LCSH: Raspberry Pi (Computer)--Programming--Popular works. | Computer programming--Popular works. Classification: LCC QA76.8.R15 (ebook) | LCC QA76.8.R15 S26 2018 (print) | DDC 005.1--dc23 LC record available at https://lccn.loc.gov/2017046491 No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Raspberry Pi is a trademark of the Raspberry Pi Foundation. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the authors nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it
There are different ways to program the ESP8266, but I'll only cover the method using the Arduino IDE. This is really easy for beginners, and it's a very familiar environment if you've used Arduino boards before. Just keep in mind that it's not limited to this option: there's also an official SDK available to program it in real C, this is very useful if you want to optimize your code or do some advanced tricks that aren't supported by the Arduino IDE. Another possibility is to flash it with a LUA interpreter, so you can upload and run LUA scripts. Or maybe you're more familiar with Python? Then you should check out the MicroPython firmware to interpret MicroPython scripts. I'm sure there's other languages available as well, so just do a quick Google search and write your code in the language of your choice.